d05017e63242a20b2bc8f5d36108b746397417ac,opennms-qosdaemon/src/main/java/org/openoss/opennms/spring/dao/OssDaoOpenNMSImpl.java,OssDaoOpenNMSImpl,localUpdateNodeCaches,#,662

Before Change


						log.info("\tOssDaoOpenNMSImpl().updateNodeCaches WARNING node.getId():"+node.getId()+" assetRecord is NULL. Not putting node in nodeCacheByUniqueID");
						continue;
					} else
						if ((assetRecord.getManagedObjectInstance()==null) || (assetRecord.getManagedObjectType()==null)){
							log.info("\tOssDaoOpenNMSImpl().updateNodeCaches WARNING node.getId():"+node.getId()+" ManagedObjectInstance and/or ManagedObjectType are NULL. Not putting node in nodeCacheByUniqueID");
							continue;
						} else {
							String uniqueid=assetRecord.getManagedObjectInstance()+assetRecord.getManagedObjectType();
							if (nodeCacheByUniqueID.get((String)uniqueid)!=null){
								log.info("\tOssDaoOpenNMSImpl().updateNodeCaches WARNING node.getId():"+node.getId()+

After Change


						// Note that the node asset record data for instance and type are only filled 
						// given default values once - subsequently changes must be explicitly set directly
						// in the database
						String moi=assetRecord.getManagedObjectInstance();
						if ((moi==null)||("".equals(moi))){
							String fid  = (node.getForeignId()==null) ? "" : node.getForeignId();
							String fsrc = (node.getForeignSource()==null) ? "" : node.getForeignSource() ;
							String label= (node.getLabel()==null) ? "" : node.getLabel();
							moi  = "Label:"+label+":ForeignSource:"+fsrc+":ForeignId():"+fid;
							log.info("\tOssDaoOpenNMSImpl().updateNodeCaches WARNING node.getId():"+node.getId()
									+" ManagedObjectInstance is NULL. Setting  ManagedObjectInstance to: "+moi);
							assetRecord.setManagedObjectInstance(moi);
						}
						String mot=assetRecord.getManagedObjectType();
						if ((mot==null)||("".equals(mot))){
							mot="UNSPECIFIED_TYPE";
							log.info("\tOssDaoOpenNMSImpl().updateNodeCaches WARNING node.getId():"
									+node.getId()+"ManagedObjectType was NULL. Setting ManagedObjectType to: "+mot);
							assetRecord.setManagedObjectType(mot);
						}
						
						// save asset data back with new node information